import { createAction } from "redux-actions";
import fetch from "../../utils/fetch.js";
import { get } from "../../utils/db";

export const getEntrantList = createAction("GET_ENTRANT_LIST");

export const fetchEntrantList = () => dispatch =>
  fetch(`${get("baseUrl")}getEntrantList`, {
    meta: {
      dipId: 63674
    }
  }).then(res => {
    if (res.success) {
      dispatch(getEntrantList(res.result));
    }
    return res;
  });
